function render(renderElement, renderData, finishedCallback) {
    try {
        //renderElement.title.textContent = renderData.title
        //renderElement.summary.textContent = renderData.summary
        //renderElement.publishDate.textContent = renderData.publishDate
        //renderElement.renderAuthor.userName.textContent = renderData.author.userName
        //renderElement.renderAuthor.userImg.src = renderData.author.userImg
        renderData.content.forEach(element => {
            let newEl = document.createElement(element.eltype)
            injectAttrs(newEl, element.attrs)
            switch (element.eltype) {
                case 'p':
                    if ("marks" in element) {
                        element.marks.forEach(markObj => {
                            let mark = document.createElement(markObj.markType)
                            mark.textContent = markObj.markText
                            injectAttrs(mark, markObj.markAttrs)
                            Object.assign(mark.style, markObj.markCss)
                            element.value = element.value
                                .replace(markObj.markText, mark.outerHTML)
                            newEl.innerHTML = element.value

                        })
                    } else {
                        newEl.textContent = element.value
                        //Object.assign(newEl.style, element.css)
                    }
                    break
                case 'img':
                    //newEl.src = element.value
                    //Object.assign(newEl.style, element.css)
                    break
                case 'video':
                    //newEl.src = element.value
                    //Object.assign(newEl.style, element.css)
                    break
            }
            Object.assign(newEl.style, element.css)
            renderElement.renderBody.appendChild(newEl)
        });
        Object.assign(renderElement.renderBody.style, renderData.renderBodyConfig.css)
        finishedCallback.onFinished()
    } catch (err) {
        finishedCallback.onFaulted(err)
    }
}

function injectAttrs(element, attrs) {
    for (let attrEl in attrs) {
        element.setAttribute(attrEl, attrs[attrEl])
    }
}